/*
 * read_fs_superblock - read the superblock of the filesystem
 * @param   uri       the place where is the filesystem palced
 * @param   fs_name   the directory named fs_name
 * @return  Return the flag whether the function is executed successfully,
 *          0 is success, 1 is failed.
 */

int
read_fs_superblock(char *uri, char *fs_name, lhdfs_super_block **superblock)
{
  char *superblock_filepath = NULL;
	
  superblock_filepath = bulid_superblock_filepath(uri, fs_name);
		
  lhdfs_super_block *sb;
		
  if( 0 != parse_superblock_file(superblock_filepath, &superblock) )
  {
      return -1;
  }
				
  *sb = superblock;

  return 0;
}

